<?php

namespace Sharks\Core\Persistence;

use Ramsey\Uuid\Uuid;

/**
 * ID，唯一编号产生机
 */
class IdGenerator {

    /**
     * uuid字符串，会去除产生uuid的‘-’符号
     */
    public static function uuidStr() {
        $uuid = self::uuid()->toString();
        $replaceUuid = str_replace("-", "", $uuid);
        return $replaceUuid;
    }

    /**
     * 返回一个uuid对象
     */
    public static function uuid() {
        $u = Uuid::uuid4();
        return $u;
    }
}